package com.xiaojianone.order.interceptor;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.stereotype.Component;

import java.util.UUID;

/**
 * ClassName  TokenRequestInterceptor
 * Author  XiaojianOne
 * Date  2025/3/15 21:09
 * Version  8.0
 */

@Component
public class TokenRequestInterceptor implements RequestInterceptor {


    @Override
    public void apply(RequestTemplate template) {
        System.out.println("拦截器执行了");

        template.header("X-Token", UUID.randomUUID().toString());

    }
}
